package com.redtree.air.components.libas
{
	import mx.controls.dataGridClasses.DataGridItemRenderer;
	import mx.controls.dataGridClasses.DataGridListData;
	
	public class CellColorItemRenderer extends DataGridItemRenderer
	{
		//传递回调函数  
		private var _cellColorFunction:Function;
		public function CellColorItemRenderer(f:Function)
		{
			super();
			this._cellColorFunction = f;
		}
		override public function set data(value:Object):void{
			super.data = value;
			if( value != null ){
				var dataField:String = DataGridListData(listData).dataField;
				setStyle("color", this._cellColorFunction.call(this,dataField,data));
			}
		}
	}
}